home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / E5TEP8 (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.1 KB  |  34 lines

  1. package com.sun.java.swing;
  2.  
  3. import com.sun.java.swing.event.ChangeEvent;
  4. import com.sun.java.swing.event.ChangeListener;
  5. import java.io.Serializable;
  6. import java.util.EventObject;
  7.  
  8. class JMenu$MenuChangeListener implements ChangeListener, Serializable {
  9.    // $FF: synthetic field
  10.    JMenu this$0;
  11.    boolean isSelected;
  12.  
  13.    public void stateChanged(ChangeEvent e) {
  14.       DefaultButtonModel model = (DefaultButtonModel)((EventObject)e).getSource();
  15.       boolean modelSelected = model.isSelected();
  16.       if (modelSelected != this.isSelected) {
  17.          if (modelSelected) {
  18.             this.this$0.fireMenuSelected();
  19.          } else {
  20.             this.this$0.fireMenuDeselected();
  21.          }
  22.  
  23.          this.isSelected = modelSelected;
  24.       }
  25.  
  26.    }
  27.  
  28.    // $FF: synthetic method
  29.    JMenu$MenuChangeListener(JMenu this$0) {
  30.       this.this$0 = this$0;
  31.       this.isSelected = false;
  32.    }
  33. }
  34.